package com.budwk.app.sqfwV2.enums;

import com.budwk.app.util.poiUtils.nutzBeanUtils.NutzIocUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@Getter
@AllArgsConstructor
public enum  PatrolAndVisitEnum {
    A(1,"宣传记录","sqfwV2/patrolAndVisit/xcjl.docx","宣传记录表","sqfwV2/patrolAndVisit/templet/宣传记录表.docx","/preview/pat/2.png"),
    B(2,"排查记录","sqfwV2/patrolAndVisit/pcjl.docx","排查记录表","sqfwV2/patrolAndVisit/templet/排查记录表.docx","/preview/pat/3.png"),
    C(3,"平安关爱","sqfwV2/patrolAndVisit/paga.docx","平安关爱记录表","sqfwV2/patrolAndVisit/templet/平安关爱记录表.docx","/preview/pat/4.png"),
    D(4,"平安建设宣传工作统计","sqfwV2/patrolAndVisit/jdgz.xlsx","平安建设宣传工作统计表","sqfwV2/patrolAndVisit/templet/平安建设宣传工作统计表.xlsx","/preview/pat/1.jpg"),
    ;
    private  int code;
    private  String name;
    private  String templat;
    private  String fileName;
    private  String blankTemplate;
    private  String previewImage;



    public static String getFileName(String name){
        String filename = Arrays.asList(PatrolAndVisitEnum.values())
                .stream()
                .filter(e -> name .equals(e.getName()) )
                .collect(Collectors.toList())
                .get(0)
                .getFileName();
        return filename;
    }

    public static String getBlankTemplate(Integer code){
        String blankTemplate = Arrays.asList(PatrolAndVisitEnum.values())
                .stream()
                .filter(e -> code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getBlankTemplate();
        return blankTemplate;
    }
    public static String getName(Integer code){
        String name = Arrays.asList(PatrolAndVisitEnum.values())
                .stream()
                .filter(e -> code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getName();
        return name;
    }

    public static String getPdfTemplatName(String name){
        String templat = Arrays.asList(PatrolAndVisitEnum.values())
                .stream()
                .filter(e -> name .equals(e.getName()) )
                .collect(Collectors.toList())
                .get(0)
                .getTemplat();
        return templat;
    }

    public static String getPdfTemplat(Integer code){
        String templat = Arrays.asList(PatrolAndVisitEnum.values())
                .stream()
                .filter(e ->  code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getTemplat();
        return templat;
    }
    public static String getFileName(Integer code){
        String fileName = Arrays.asList(PatrolAndVisitEnum.values())
                .stream()
                .filter(e -> code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getFileName();
        return fileName;
    }

}
